//商品分类一级
export function fetchList() {
  const data = {
    "code": 200,
    "message": "操作成功",
    "data": {
      "pageNum": 1,
      "pageSize": 5,
      "totalPage": 1,
      "total": 5,
      "list": [{
        "id": 1,
        "parentId": 0,
        "name": "服装",
        "level": 0,
        "showStatus": 1,
        "sort": 1,
        "icon": null,
        "keywords": "服装",
        "description": null
      }, {
        "id": 2,
        "parentId": 0,
        "name": "手机数码",
        "level": 0,
        "showStatus": 1,
        "sort": 1,
        "icon": null,
        "keywords": "手机数码",
        "description": null
      }, {
        "id": 3,
        "parentId": 0,
        "name": "家用电器",
        "level": 0,
        "showStatus": 1,
        "sort": 1,
        "icon": null,
        "keywords": "家用电器",
        "description": null
      }, {
        "id": 4,
        "parentId": 0,
        "name": "家具家装",
        "level": 0,
        "showStatus": 1,
        "sort": 1,
        "icon": null,
        "keywords": "家具家装",
        "description": null
      }, {
        "id": 5,
        "parentId": 0,
        "name": "汽车用品",
        "level": 0,
        "showStatus": 1,
        "sort": 1,
        "icon": null,
        "keywords": "汽车用品",
        "description": null
      }]
    }
  }
  return {
    url: 'goodsCate/fetchList',
    type: 'post',
    data: data
  }
}

// 商品分类,含二级
export function fetchListWithChildren() {
  const data = {
    "code": 200,
    "message": "操作成功",
    "data": [{
      "id": 1,
      "parentId": null,
      "name": "服装",
      "level": null,
      "showStatus": null,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null,
      "children": [{
        "id": 7,
        "parentId": null,
        "name": "外套",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 8,
        "parentId": null,
        "name": "T恤",
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 9,
        "parentId": null,
        "name": "休闲裤",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 10,
        "parentId": null,
        "name": "牛仔裤",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 11,
        "parentId": null,
        "name": "衬衫",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 29,
        "parentId": null,
        "name": "男鞋",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }]
    }, {
      "id": 2,
      "parentId": null,
      "name": "手机数码",
      "level": null,
      "showStatus": null,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null,
      "children": [{
        "id": 19,
        "parentId": null,
        "name": "手机通讯",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 30,
        "parentId": null,
        "name": "手机配件",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 31,
        "parentId": null,
        "name": "摄影摄像",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 32,
        "parentId": null,
        "name": "影音娱乐",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 33,
        "parentId": null,
        "name": "数码配件",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 34,
        "parentId": null,
        "name": "智能设备",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }]
    }, {
      "id": 3,
      "parentId": null,
      "name": "家用电器",
      "level": null,
      "showStatus": null,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null,
      "children": [{
        "id": 35,
        "parentId": null,
        "name": "电视",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 36,
        "parentId": null,
        "name": "空调",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 37,
        "parentId": null,
        "name": "洗衣机",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 38,
        "parentId": null,
        "name": "冰箱",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 39,
        "parentId": null,
        "name": "厨卫大电",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 40,
        "parentId": null,
        "name": "厨房小电",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 41,
        "parentId": null,
        "name": "生活电器",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 42,
        "parentId": null,
        "name": "个护健康",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }]
    }, {
      "id": 4,
      "parentId": null,
      "name": "家具家装",
      "level": null,
      "showStatus": null,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null,
      "children": [{
        "id": 43,
        "parentId": null,
        "name": "厨房卫浴",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 44,
        "parentId": null,
        "name": "灯饰照明",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 45,
        "parentId": null,
        "name": "五金工具",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 46,
        "parentId": null,
        "name": "卧室家具",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 47,
        "parentId": null,
        "name": "客厅家具",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }]
    }, {
      "id": 5,
      "parentId": null,
      "name": "汽车用品",
      "level": null,
      "showStatus": null,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null,
      "children": [{
        "id": 48,
        "parentId": null,
        "name": "全新整车",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 49,
        "parentId": null,
        "name": "车载电器",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 50,
        "parentId": null,
        "name": "维修保养",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }, {
        "id": 51,
        "parentId": null,
        "name": "汽车装饰",
        "level": null,
        "showStatus": null,
        "sort": null,
        "icon": null,
        "keywords": null,
        "description": null
      }]
    }]
  }

  return {
    url: 'category/fetchListWithChildren',
    type: 'post',
    data: data
  }
}
//根据一级查找二级分类
export function fetchListSon() {
  const data = {
    "code": 200,
    "message": "操作成功",
    "data": [{
      "id": 48,
      "parentId": 1,
      "name": "全新整车",
      "level": 1,
      "showStatus": 1,
      "sort": 100,
      "icon": null,
      "keywords": null,
      "description": null
    }, {
      "id": 49,
      "parentId": 1,
      "name": "车载电器",
      "level": 1,
      "showStatus": 1,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null
    }, {
      "id": 50,
      "parentId": 1,
      "name": "维修保养",
      "level": 1,
      "showStatus": 1,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null
    }, {
      "id": 51,
      "parentId": 1,
      "name": "汽车装饰",
      "level": 1,
      "showStatus": 1,
      "sort": null,
      "icon": null,
      "keywords": null,
      "description": null
    }]
  }

  return {
    url: 'category/fetchListSon',
    type: 'post',
    data: data
  }
}

//显示或者隐藏
export function updateShowStatus() {
  const data = {
    "code": 200,
    "message": "操作成功",
    "data": []
  }
  return {
    url: 'category/updateShowStatus',
    method: 'post',
    data: data
  }
}

//显示或者隐藏
export function updateDeleteStatus() {
  const data = {
    "code": 200,
    "message": "操作成功",
    "data": []
  }
  return {
    url: 'category/updateDeleteStatus',
    method: 'post',
    data: data
  }
}


export function info() {

  const data = {
    "code": 200,
    "message": "操作成功",
    "data": {
      "id": 7,
      "parentId": 0,
      "name": "外套",
      "level": 1,
      "showStatus": 1,
      "sort": 0,
      "icon": "",
      "keywords": "外套",
      "description": "外套"
    }
  }
  return {
    url: 'category/info',
    method: 'post',
    data: data
  }
}
